home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / text / misc / WordConverter.lha / WordConverter / rexx / CEDImportWord.ced next >
Text File  |  1999-02-01  |  2KB  |  70 lines

  1. /*rx
  2.  *  $VER: CEDImportWord.ced 1.0.0 (19.10.97) ©1997 Peter Drapich
  3.  *  This ARexx script is for use with CygnusEd text editor.
  4.  *
  5.  *  CEDImportWord.ced is a part of WordConverter archive and imports texts from documents
  6.  *  created with Word for Windows or Mac into CygnusEd.
  7.  *
  8.  *  During execution of this script, you'll be asked with the filerequester for the
  9.  *  source Word document filename.
  10.  *  This script uses WordConverter to convert Word documents into text.
  11.  *  If WordConverter isnt in the current path, you'll be prompted to select its current
  12.  *  location. 
  13.  *
  14.  *  WordConverter and CEDImportWord.ced were written by Peter Drapich in 1997
  15.  *  and are shareware software copyrighted by Peter Drapich.
  16.  *
  17.  *  Email any remarks or new ideas to: docent@union.org.pl
  18.  *
  19.  */
  20.     CR = '0A'X
  21.     ERR_REVUNKNOWN=6        /* these are internal error codes, returned by WordConverter */
  22.     ERR_NOTWORDFILE=8
  23.     options results
  24.     address "rexx_ced"
  25.     options failat 20
  26.     filename = 'WordConverter'
  27.     do while ~exists(filename)
  28.         msgtext='Couldnt find WordConverter in current path.'||CR||'Please select its correct location and filename.'
  29.         okay1 msgtext
  30.         getfilename 'WordConverter'
  31.         if result = 'result' then exit 0
  32.         filename = result
  33.     end
  34.     okay1 'Please select Word document to import.'
  35.     filename = '"'||filename||'"'
  36.     getfilename ''
  37.     if (result = 'result') then
  38.     do
  39.         okay1 'No source filename was specified.'
  40.         exit 0
  41.     end
  42.     srcfilename = result
  43.     srcfilename = '"'||srcfilename||'"'
  44.     tempname = 'T:wordconv.temp'
  45.     commandrc=1
  46.     do while (commandrc)
  47.         address command filename srcfilename tempname
  48.         commandrc = rc
  49.         if commandrc=ERR_REVUNKNOWN then do
  50.             msgtext='Unknown revision of Word document'||CR||'Do you want to read it anyway ?'
  51.             okay2 msgtext
  52.             replyrc=result
  53.             if replyrc=0 then exit 0
  54.             address command filename srcfilename tempname 'force'
  55.             commandrc = rc
  56.         end
  57.         if commandrc=ERR_NOTWORDFILE then do
  58.             okay1 'This is not a Word file.'
  59.             exit 0
  60.         end
  61.         if commandrc>0 & commandrc~=ERR_REVUNKNOWN then do
  62.             okay1 'An error has occured.'
  63.             exit 0
  64.         end
  65.     end
  66.     'open new'
  67.     'open...' tempname||'.txt'
  68.     address command 'delete' tempname||'.txt quiet'
  69.     exit 0
  70.